package lab02.test11;

public class Square extends Rectangle {
    double side;
    @Override
    double area() {

        return side*side;
    }
    double perimeter(){
        return side*4;
    }
    double diagonal(){
        return Math.sqrt(side*side+side*side);
    }
    @Override
    public void printMyWay() {
        System.out.println("边长："+side+"面积"+area()+"周长"+perimeter()+"对角线"+diagonal());

    }
}
